<template>
  <div id="newsIndex">
    <el-form>
      <el-row :gutter="20">
        <el-col :xs="24" :sm="6" :md="4" :lg="4" :xl="3">
          <div class="label-wrap category">
            <label for="">类型：</label>
            <div class="wrap-content">
              <el-select v-model="newsType" placeholder="请选择" style="width:100%">
                <el-option v-for="item in newsTypeOption" :key="item.id" :label="item.label" :value="item.value"></el-option>
              </el-select>
            </div>
          </div>
        </el-col>
        <el-col :xs="24" :sm="9" :md="7" :lg="7" :xl="6">
          <div class="label-wrap date">
            <label for="">日期：</label>
            <div class="wrap-content">
              <el-date-picker style="width:100%" v-model="daterange" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
              </el-date-picker>
            </div>
          </div>
        </el-col>
        <el-col :xs="24" :sm="6" :md="4" :lg="4" :xl="3">
          <div class="label-wrap search-key">
            <label for="">关键字：</label>
            <div class="wrap-content">
              <el-select v-model="searchKey" placeholder="请选择" style="width:100%">
                <el-option v-for="item in searchKeyOption" :key="item.id" :label="item.label" :value="item.value"></el-option>
              </el-select>
            </div>
          </div>
        </el-col>
        <el-col :xs="24" :sm="6" :md="4" :lg="4" :xl="3">
          <div class="label-wrap search-keyword">
            <div class="wrap-content">
              <el-input v-model="keyword" placeholder="请输入内容"></el-input>
            </div>
          </div>
        </el-col>
        <el-col :xs="24" :sm="6" :md="4" :lg="4" :xl="3">
          <div class="label-wrap search-keyword">
            <div class="wrap-content">
              <el-button type="danger" size="small">危险按钮</el-button>
            </div>
          </div>
        </el-col>

      </el-row>
    </el-form>
  </div>
</template>

<script>
import { reactive, ref, computed } from "@vue/composition-api";
export default {
  name: "newsIndex",
  setup (props, { }) {
    const newsTypeOption = reactive([
      { value: "1", label: "国际新闻" },
      { value: "2", label: "国内新闻" },
    ]);

    const searchKeyOption = reactive([
      { value: "id", label: "ID" },
      { value: "title", label: "标题" },
    ]);
    const newsType = ref("2");
    const daterange = ref("");
    const searchKey= ref("id");
    const keyword= ref("");

    return {
      newsType,
      newsTypeOption,
      daterange,
      searchKeyOption,
      searchKey,
      keyword,
    }
  }
}
</script>

<style lang="scss" scoped>
.label-wrap {
  &.category {
    @include labelDom(left, 60, 40);
  }
  &.date {
    @include labelDom(center, 60, 40);
  }
  &.search-key {
    @include labelDom(center, 60, 40);
  }
}
</style>
